package cms.jason.entity;

import com.cn.lotary.base.dao.AbstractEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Jason
 */
@Entity
@Table(catalog = "cms", name = "account", schema = "")
@XmlRootElement
public class Account extends AbstractEntity {

    private static final long serialVersionUID = 1L;
    @Size(max = 45)
    @Column(length = 45)
    private String name;
    @Size(max = 45)
    @Column(length = 45)
    private String password;
    @Size(max = 45)
    @Column(length = 45)
    private String remark;
    @JoinColumn(name = "permission", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Permission permission;

    public Account() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Permission getPermission() {
        return permission;
    }

    public void setPermission(Permission permission) {
        this.permission = permission;
    }

    @Override
    public String toString() {
        return "Account{" + "name=" + name + ", password=" + password + ", remark=" + remark + ", permission=" + permission + '}';
    }
}
